package com.example.beans;

import org.springframework.beans.factory.FactoryBean;

/**
 * @author Daniel
 */
public class ColorFactoryBean implements FactoryBean<Color> {
    @Override
    public Color getObject() throws Exception {
        System.out.println("Invoke ColorFactoryBean.getObject()");
        return new Color();
    }

    @Override
    public Class<?> getObjectType() {
        return Color.class;
    }

    /**
     * Bean是否是单例对象
     * @return true 表示单例， false 表示多例
     */
    @Override
    public boolean isSingleton() {
        return true;
    }
}
